package com.lrs.java.j2se_self.net;
import java.io.*;
import java.net.*;

public class TestTwoServer {
	public static void main(String[] args){
		
		boolean started = false;
		
		try {
			ServerSocket ss = new ServerSocket(5555);
System.out.println("a client connect!");
			started = true;
			while(started){
				boolean isconnect = false;
				Socket s = ss.accept();
				isconnect = true;
				DataInputStream dis = new DataInputStream(s.getInputStream());
				while(isconnect){
					String str = dis.readUTF();
					System.out.println(str);
				}
				dis.close();
				s.close();
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
